<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul>
      <li>1</li>
      <li id="li2">2</li>
      <li>3</li>
    </ul>

    <script>
      /*
        1. querySelectorAll 批量获取，返回所有匹配元素(类数组)
        2. querySelector 返回所有匹配的第一个元素（对象）
      */
      const lis1 = document.querySelectorAll("ul li");
      const lis2 = document.querySelector("ul li");

      console.log(lis1);
      console.log(lis2);
    </script>
  </body>
</html>
